var cc__decorate = __decorate;
Object.defineProperty(exports, "__esModule", {
  value: true
});
var $2GoldManager = require("GoldManager");
var $2SceneStage = require("SceneStage");
var $2KDefine = require("KDefine");
var $2PlantBase = require("PlantBase");
var r = cc._decorator.ccclass;
var def_Plant2 = /* */function (_l$default) {
  babel_inherits(c, _l$default);
  var _super65 = babel_createSuper(c);
  function c() {
    babel_classCallCheck(this, c);
    return _super65.apply(this, arguments);
  }
  babel_createClass(c, [{
    key: "checkTarget",
    value: function checkTarget() {
      return true;
    }
  }, {
    key: "shoot",
    value: function shoot() {
      var _this143 = this;
      if (0 == this.remainCD) {
        var _e70 = this;
        var _t41 = this.dragon.setAnimation(0, "dazhao", true);
        var _a27 = 0;
        this.dragon.setCompleteListener(function () {
          if (++_a27 == _this143.skillNums) {
            _e70.setState($2KDefine.State.wait);
            _this143.attackTimes += _this143.attackCD;
            _this143.remainCD = _this143.skillCD;
          }
        });
        this.dragon.setTrackEventListener(_t41, function (e, t) {
          "dazhao" == t.data.name && ($2GoldManager.default.instance.getItem(_this143.node.x + _this143.skillPos.x, _this143.node.y + _this143.skillPos.y, _this143.row, _this143.skillDamage * _this143.damage).parent = $2SceneStage.default.instance.sunParent);
        });
      } else {
        var _e71 = this;
        var _t42 = this.dragon.setAnimation(0, "shengchan", false);
        this.dragon.setCompleteListener(function () {
          _e71.setState($2KDefine.State.wait);
        });
        this.dragon.setTrackEventListener(_t42, function (e, t) {
          "shengchan" == t.data.name && ($2GoldManager.default.instance.getItem(_this143.node.x + _this143.shootPo.x, _this143.node.y + _this143.shootPo.y, _this143.row, _this143.damage).parent = $2SceneStage.default.instance.sunParent);
        });
        this.attackTimes += this.attackCD;
      }
    }
  }]);
  return c;
}($2PlantBase.default);
def_Plant2 = cc__decorate([r], def_Plant2);
exports.default = def_Plant2;